home *** CD-ROM | disk | FTP | other *** search
Wrap
FFFFSSSSTTTTRRRREEEEAAAAMMMM((((3333CCCC++++++++)))) FFFFSSSSTTTTRRRREEEEAAAAMMMM((((3333CCCC++++++++)))) NNNNAAAAMMMMEEEE fstream - iostream and streambuf specialized to files SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_...._hhhh_>>>> _tttt_yyyy_pppp_eeee_dddd_eeee_ffff _llll_oooo_nnnn_gggg _ssss_tttt_rrrr_eeee_aaaa_mmmm_oooo_ffff_ffff_,,,, _ssss_tttt_rrrr_eeee_aaaa_mmmm_pppp_oooo_ssss_;;;; _cccc_llll_aaaa_ssss_ssss _iiii_oooo_ssss _{{{{ _pppp_uuuu_bbbb_llll_iiii_cccc_:::: _eeee_nnnn_uuuu_mmmm _ssss_eeee_eeee_kkkk______dddd_iiii_rrrr _{{{{ _bbbb_eeee_gggg_,,,, _cccc_uuuu_rrrr_,,,, _eeee_nnnn_dddd _}}}} _;;;; _eeee_nnnn_uuuu_mmmm _oooo_pppp_eeee_nnnn______mmmm_oooo_dddd_eeee _{{{{ _iiii_nnnn_,,,, _oooo_uuuu_tttt_,,,, _aaaa_tttt_eeee_,,,, _aaaa_pppp_pppp_,,,, _tttt_rrrr_uuuu_nnnn_cccc_,,,, _nnnn_oooo_cccc_rrrr_eeee_aaaa_tttt_eeee_,,,, _nnnn_oooo_rrrr_eeee_pppp_llll_aaaa_cccc_eeee _}}}} _;;;; _eeee_nnnn_uuuu_mmmm _iiii_oooo______ssss_tttt_aaaa_tttt_eeee _{{{{ _gggg_oooo_oooo_dddd_bbbb_iiii_tttt_====_0000_,,,, _eeee_oooo_ffff_bbbb_iiii_tttt_,,,, _ffff_aaaa_iiii_llll_bbbb_iiii_tttt_,,,, _bbbb_aaaa_dddd_bbbb_iiii_tttt _}}}} _;;;; _////_//// _aaaa_nnnn_dddd _llll_oooo_tttt_ssss _oooo_ffff _oooo_tttt_hhhh_eeee_rrrr _ssss_tttt_uuuu_ffff_ffff_,,,, _ssss_eeee_eeee _iiii_oooo_ssss_((((_3333_CCCC_++++_++++_)))) _...._...._.... _}}}} _;;;; _cccc_llll_aaaa_ssss_ssss _iiii_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm _:::: _iiii_ssss_tttt_rrrr_eeee_aaaa_mmmm _{{{{ _iiii_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_)))) _;;;; _~~~~_iiii_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_)))) _;;;; _iiii_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr_**** _nnnn_aaaa_mmmm_eeee_,,,, _iiii_nnnn_tttt _====_iiii_oooo_ssss_::::_::::_iiii_nnnn_,,,, _iiii_nnnn_tttt _pppp_rrrr_oooo_tttt _====_ffff_iiii_llll_eeee_bbbb_uuuu_ffff_::::_::::_oooo_pppp_eeee_nnnn_pppp_rrrr_oooo_tttt_)))) _;;;; _iiii_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_iiii_nnnn_tttt _ffff_dddd_)))) _;;;; _iiii_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_iiii_nnnn_tttt _ffff_dddd_,,,, _cccc_hhhh_aaaa_rrrr_**** _pppp_,,,, _iiii_nnnn_tttt _llll_)))) _;;;; _vvvv_oooo_iiii_dddd _aaaa_tttt_tttt_aaaa_cccc_hhhh_((((_iiii_nnnn_tttt _ffff_dddd_)))) _;;;; _vvvv_oooo_iiii_dddd _cccc_llll_oooo_ssss_eeee_((((_)))) _;;;; _vvvv_oooo_iiii_dddd _oooo_pppp_eeee_nnnn_((((_cccc_hhhh_aaaa_rrrr_**** _nnnn_aaaa_mmmm_eeee_,,,, _iiii_nnnn_tttt _====_iiii_oooo_ssss_::::_::::_iiii_nnnn_,,,, _iiii_nnnn_tttt _pppp_rrrr_oooo_tttt_====_ffff_iiii_llll_eeee_bbbb_uuuu_ffff_::::_::::_oooo_pppp_eeee_nnnn_pppp_rrrr_oooo_tttt_)))) _;;;; _ffff_iiii_llll_eeee_bbbb_uuuu_ffff_**** _rrrr_dddd_bbbb_uuuu_ffff_((((_)))) _;;;; _vvvv_oooo_iiii_dddd _ssss_eeee_tttt_bbbb_uuuu_ffff_((((_cccc_hhhh_aaaa_rrrr_**** _pppp_,,,, _iiii_nnnn_tttt _llll_)))) _;;;; _}}}}_;;;; _cccc_llll_aaaa_ssss_ssss _oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm _:::: _oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm _{{{{ _oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_)))) _;;;; _~~~~_oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_)))) _;;;; _oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr_**** _nnnn_aaaa_mmmm_eeee_,,,, _iiii_nnnn_tttt _====_iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt_,,,, _iiii_nnnn_tttt _pppp_rrrr_oooo_tttt _====_ffff_iiii_llll_eeee_bbbb_uuuu_ffff_::::_::::_oooo_pppp_eeee_nnnn_pppp_rrrr_oooo_tttt_)))) _;;;; _oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_iiii_nnnn_tttt _ffff_dddd_)))) _;;;; _oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_iiii_nnnn_tttt _ffff_dddd_,,,, _cccc_hhhh_aaaa_rrrr_**** _pppp_,,,, _iiii_nnnn_tttt _llll_)))) _;;;; _vvvv_oooo_iiii_dddd _aaaa_tttt_tttt_aaaa_cccc_hhhh_((((_iiii_nnnn_tttt _ffff_dddd_)))) _;;;; _vvvv_oooo_iiii_dddd _cccc_llll_oooo_ssss_eeee_((((_)))) _;;;; _vvvv_oooo_iiii_dddd _oooo_pppp_eeee_nnnn_((((_cccc_hhhh_aaaa_rrrr_**** _nnnn_aaaa_mmmm_eeee_,,,, _iiii_nnnn_tttt _====_iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt_,,,, _iiii_nnnn_tttt _pppp_rrrr_oooo_tttt_====_ffff_iiii_llll_eeee_bbbb_uuuu_ffff_::::_::::_oooo_pppp_eeee_nnnn_pppp_rrrr_oooo_tttt_)))) _;;;; _ffff_iiii_llll_eeee_bbbb_uuuu_ffff_**** _rrrr_dddd_bbbb_uuuu_ffff_((((_)))) _;;;; _vvvv_oooo_iiii_dddd _ssss_eeee_tttt_bbbb_uuuu_ffff_((((_cccc_hhhh_aaaa_rrrr_**** _pppp_,,,, _iiii_nnnn_tttt _llll_)))) _;;;; _}}}}_;;;; _cccc_llll_aaaa_ssss_ssss _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm _:::: _iiii_oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm _{{{{ _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_)))) _;;;; _~~~~_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_)))) _;;;; _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr_**** _nnnn_aaaa_mmmm_eeee_,,,, _iiii_nnnn_tttt _mmmm_oooo_dddd_eeee_,,,, _iiii_nnnn_tttt _pppp_rrrr_oooo_tttt _====_ffff_iiii_llll_eeee_bbbb_uuuu_ffff_::::_::::_oooo_pppp_eeee_nnnn_pppp_rrrr_oooo_tttt_)))) _;;;; _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_iiii_nnnn_tttt _ffff_dddd_)))) _;;;; PPPPaaaaggggeeee 1111 FFFFSSSSTTTTRRRREEEEAAAAMMMM((((3333CCCC++++++++)))) FFFFSSSSTTTTRRRREEEEAAAAMMMM((((3333CCCC++++++++)))) _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_iiii_nnnn_tttt _ffff_dddd_,,,, _cccc_hhhh_aaaa_rrrr_**** _pppp_,,,, _iiii_nnnn_tttt _llll_)))) _;;;; _vvvv_oooo_iiii_dddd _aaaa_tttt_tttt_aaaa_cccc_hhhh_((((_iiii_nnnn_tttt _ffff_dddd_)))) _;;;; _vvvv_oooo_iiii_dddd _cccc_llll_oooo_ssss_eeee_((((_)))) _;;;; _vvvv_oooo_iiii_dddd _oooo_pppp_eeee_nnnn_((((_cccc_hhhh_aaaa_rrrr_**** _nnnn_aaaa_mmmm_eeee_,,,, _iiii_nnnn_tttt _mmmm_oooo_dddd_eeee_,,,, _iiii_nnnn_tttt _pppp_rrrr_oooo_tttt_====_ffff_iiii_llll_eeee_bbbb_uuuu_ffff_::::_::::_oooo_pppp_eeee_nnnn_pppp_rrrr_oooo_tttt_)))) _;;;; _ffff_iiii_llll_eeee_bbbb_uuuu_ffff_**** _rrrr_dddd_bbbb_uuuu_ffff_((((_)))) _;;;; _vvvv_oooo_iiii_dddd _ssss_eeee_tttt_bbbb_uuuu_ffff_((((_cccc_hhhh_aaaa_rrrr_**** _pppp_,,,, _iiii_nnnn_tttt _llll_)))) _;;;; _}}}}_;;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _iiii_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm, _oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm, and _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm specialize _iiii_ssss_tttt_rrrr_eeee_aaaa_mmmm, _oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm, and _iiii_oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm, respectively, to files. That is, the associated _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff will be a _ffff_iiii_llll_eeee_bbbb_uuuu_ffff. In the following descriptions, assume - _f is any of _iiii_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm, _oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm, or _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm. - _p_f_b is a _ffff_iiii_llll_eeee_bbbb_uuuu_ffff_****. - _p_s_b is a _ssss_tttt_rrrr_eeee_aaaa_mmmm_bbbb_uuuu_ffff_****. - _n_a_m_e and _p_t_r are _cccc_hhhh_aaaa_rrrr_****s. - _i, _f_d, _l_e_n, and _p_r_o_t are _iiii_nnnn_tttts. - _m_o_d_e is an _iiii_nnnn_tttt representing an _oooo_pppp_eeee_nnnn______mmmm_oooo_dddd_eeee. CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss The constructors for _x_ssss_tttt_rrrr_eeee_aaaa_mmmm, where _x is either _iiii_ffff, _oooo_ffff, or _ffff, are: _x_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_)))) Constructs an unopened _x_ssss_tttt_rrrr_eeee_aaaa_mmmm. _x_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_n_a_m_e_,,,, _m_o_d_e_,,,, _p_r_o_t_)))) Constructs an _x_ssss_tttt_rrrr_eeee_aaaa_mmmm and opens file _n_a_m_e using _m_o_d_e as the open mode and _p_r_o_t as the protection mode. By default, _p_r_o_t is _ffff_iiii_llll_eeee_bbbb_uuuu_ffff_::::_::::_oooo_pppp_eeee_nnnn_pppp_rrrr_oooo_tttt, which is 0644. The error state (_iiii_oooo______ssss_tttt_aaaa_tttt_eeee) of the constructed _x_ssss_tttt_rrrr_eeee_aaaa_mmmm will indicate failure in case the _oooo_pppp_eeee_nnnn fails. _x_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_d_)))) Constructs an _x_ssss_tttt_rrrr_eeee_aaaa_mmmm connected to file descriptor _d, which must be already open. _x_ssss_tttt_rrrr_eeee_aaaa_mmmm_((((_d_,,,,_p_t_r_,,,,_l_e_n_)))) Constructs an _x_ssss_tttt_rrrr_eeee_aaaa_mmmm connected to file descriptor _d, and, in addition, initializes the associated _ffff_iiii_llll_eeee_bbbb_uuuu_ffff to use the _l_e_n bytes at _p_t_r as the reserve area. If _p_t_r is null or _l_e_n is 0, the _ffff_iiii_llll_eeee_bbbb_uuuu_ffff will be unbuffered. MMMMeeeemmmmbbbbeeeerrrr ffffuuuunnnnccccttttiiiioooonnnnssss _f_...._aaaa_tttt_tttt_aaaa_cccc_hhhh_((((_d_)))) Connects _f to the file descriptor _d. A failure occurs when _f is already connected to a file. A failure sets _iiii_oooo_ssss_::::_::::_ffff_aaaa_iiii_llll_bbbb_iiii_tttt in _f's error state. PPPPaaaaggggeeee 2222 FFFFSSSSTTTTRRRREEEEAAAAMMMM((((3333CCCC++++++++)))) FFFFSSSSTTTTRRRREEEEAAAAMMMM((((3333CCCC++++++++)))) _f_...._cccc_llll_oooo_ssss_eeee_((((_)))) Closes any associated _ffff_iiii_llll_eeee_bbbb_uuuu_ffff and thereby breaks the connection of the _f to a file. _f's error state is cleared except on failure. A failure occurs when the call to _f_...._rrrr_dddd_bbbb_uuuu_ffff_((((_))))_----_>>>>_cccc_llll_oooo_ssss_eeee_((((_)))) fails. _f_...._oooo_pppp_eeee_nnnn_((((_n_a_m_e_,,,,_m_o_d_e_,,,,_p_r_o_t_)))) Opens file _n_a_m_e and connects _f to it. If the file does not already exist, an attempt is made to create it with protection mode _p_r_o_t unless _iiii_oooo_ssss_::::_::::_nnnn_oooo_cccc_rrrr_eeee_aaaa_tttt_eeee is set. By default, _p_r_o_t is _ffff_iiii_llll_eeee_bbbb_uuuu_ffff_::::_::::_oooo_pppp_eeee_nnnn_pppp_rrrr_oooo_tttt, which is 0644. Failure occurs if _f is already open, or the call to _f_...._rrrr_dddd_bbbb_uuuu_ffff_((((_))))_----_>>>>_oooo_pppp_eeee_nnnn_((((_)))) fails. _iiii_oooo_ssss_::::_::::_ffff_aaaa_iiii_llll_bbbb_iiii_tttt is set in _f's error status on failure. The members of _oooo_pppp_eeee_nnnn______mmmm_oooo_dddd_eeee are bits that may be or'ed together. (Because the or'ing returns an _iiii_nnnn_tttt, _oooo_pppp_eeee_nnnn_((((_)))) takes an _iiii_nnnn_tttt rather than an _oooo_pppp_eeee_nnnn______mmmm_oooo_dddd_eeee argument.) The meanings of these bits in _m_o_d_e are: _iiii_oooo_ssss_::::_::::_aaaa_pppp_pppp A seek to the end of file is performed. Subsequent data written to the file is always added (appended) at the end of file. On some systems this is implemented in the operating system. In others it is implemented by seeking to the end of the file before each write. _iiii_oooo_ssss_::::_::::_aaaa_pppp_pppp implies _iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt. _iiii_oooo_ssss_::::_::::_aaaa_tttt_eeee A seek to the end of the file is performed during the _oooo_pppp_eeee_nnnn_((((_)))). _iiii_oooo_ssss_::::_::::_aaaa_tttt_eeee does not imply _iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt. _iiii_oooo_ssss_::::_::::_iiii_nnnn The file is opened for input. _iiii_oooo_ssss_::::_::::_iiii_nnnn is implied by construction and opens of _iiii_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmms. For _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmms it indicates that input operations should be allowed if possible. Is is legal to include _iiii_oooo_ssss_::::_::::_iiii_nnnn in the modes of an _oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm in which case it implies that the original file (if it exists) should not be truncated. If the file being opened for input does not exist, the open will fail. _iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt The file is opened for output. _iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt is implied by construction and opens of _oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmms. For _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm it says that output operations are to be allowed. _iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt may be specified even if _p_r_o_t does not permit output. _iiii_oooo_ssss_::::_::::_tttt_rrrr_uuuu_nnnn_cccc If the file already exists, its contents will be truncated (discarded). This mode is implied when _iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt is specified (including implicit specification for _oooo_ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm) and neither _iiii_oooo_ssss_::::_::::_aaaa_tttt_eeee nor _iiii_oooo_ssss_::::_::::_aaaa_pppp_pppp is specified. PPPPaaaaggggeeee 3333 FFFFSSSSTTTTRRRREEEEAAAAMMMM((((3333CCCC++++++++)))) FFFFSSSSTTTTRRRREEEEAAAAMMMM((((3333CCCC++++++++)))) _iiii_oooo_ssss_::::_::::_nnnn_oooo_cccc_rrrr_eeee_aaaa_tttt_eeee If the file does not already exist, the _oooo_pppp_eeee_nnnn_((((_)))) will fail. _iiii_oooo_ssss_::::_::::_nnnn_oooo_rrrr_eeee_pppp_llll_aaaa_cccc_eeee If the file already exists, the _oooo_pppp_eeee_nnnn_((((_)))) will fail. Only valid with _iiii_oooo_ssss_::::_::::_oooo_uuuu_tttt. _p_f_b_====_f_...._rrrr_dddd_bbbb_uuuu_ffff_((((_)))) Returns a pointer to the _ffff_iiii_llll_eeee_bbbb_uuuu_ffff associated with _f. _ffff_ssss_tttt_rrrr_eeee_aaaa_mmmm_::::_::::_rrrr_dddd_bbbb_uuuu_ffff_((((_)))) has the same meaning as _iiii_oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm_::::_::::_rrrr_dddd_bbbb_uuuu_ffff_((((_)))) but is typed differently. _f_...._ssss_eeee_tttt_bbbb_uuuu_ffff_((((_p_,,,,_l_e_n_)))) Has the usual effect of a _ssss_eeee_tttt_bbbb_uuuu_ffff_((((_)))) (see _ffff_iiii_llll_eeee_bbbb_uuuu_ffff(3C++)), offering space for a reserve area or requesting unbuffered I/O. Normally the returned _p_s_b is _f_...._rrrr_dddd_bbbb_uuuu_ffff_((((_)))), but it is 0 on failure. A failure occurs if _f is open or the call to _f_...._rrrr_dddd_bbbb_uuuu_ffff_((((_))))_----_>>>>_ssss_eeee_tttt_bbbb_uuuu_ffff fails. SSSSEEEEEEEE AAAALLLLSSSSOOOO _ffff_iiii_llll_eeee_bbbb_uuuu_ffff(3C++), _iiii_ssss_tttt_rrrr_eeee_aaaa_mmmm(3C++), _iiii_oooo_ssss(3C++), _oooo_ssss_tttt_rrrr_eeee_aaaa_mmmm(3C++), _ssss_bbbb_uuuu_ffff_...._pppp_uuuu_bbbb(3C++) PPPPaaaaggggeeee 4444